home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
lc.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-22
|
818b
|
38 lines
// LC.CPP -
// this module contains the basic routines for class LinkClass.
//
#include <stdlib.h>
#include <alloc.h>
#include <iostream.h>
#include "wtwg.h"
#include "dblib.h"
void LinkClass::initBase ()
{
if ( nx == NULL )
{
// make sure a previously empty node pts to itself.
// ensures that static nodes are correctly initialized
// ...when the first element in the list is added.
nx = pv = this;
}
};
LinkClass::LinkClass(LinkClass& base, void *data)
{
base.initBase();
dt=data;
this->insertBelow(base); // chain grows so oldest = base.first()
};
void LinkClass::unLink ()
{
pv->nx = nx;
nx->pv = pv;
}; // end LinkClass::unLink()
//----------------- end of LC.CPP --------------------